package T;

import reflection.Person;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;

/**
 * @Author:zimmor
 * @Date: 2021/10/30 9:22
 * @Description
 * @version: 1.0.0
 */

public class Demo {
    public static void main(String[] args) {
        Class<Person> personClass = Person.class;
        Method[] methods = personClass.getMethods();
        System.out.println("所有公共方法==============================");
        for (Method method : methods) {
            System.out.println(method.getName());
        }
        System.out.println("所有方法==============================");
        Method[] declaredMethods = personClass.getDeclaredMethods();
        for (Method declaredMethod : declaredMethods) {
            System.out.println(declaredMethod.getName());
        }

    }
}
